export const useSetting = defineStore('setting', {
    state: () => ({
        setting: {
            // 主题样式
            theme: 'default',
            // 左侧导航是否展开
            leftNavigationIsCollapsed: false
        }
    }),
    getters: {
        // 获取主题类型
        getTheme: (state) => {
            return state.setting.theme;
        },

        // 获取左侧导航是否展开
        getLeftNavigationIsCollapsed: (state) => {
            return state.setting.leftNavigationIsCollapsed;
        }
    },
    actions: {
        // 设置主题央视
        setTheme(theme: string) {
            this.setting.theme = theme;
        },

        // 设置左侧导航是否展开
        setLeftNavigationIsCollapsed(isCollapsed: boolean) {
            this.setting.leftNavigationIsCollapsed = isCollapsed;
        }
    }
})